package com.yoipdu.im1.util;

import java.util.HashMap;
import java.util.Map;

public class JsonData {
    private Map<String, Object> content;

    public JsonData() {
        content = new HashMap<String, Object>();
        content.put("isError", false);
    }

    public void put(String key, Object obj) {
        this.content.put(key, obj);
    }

    public void error(String errorMessage) {
        this.content.clear();
        content.put("isError", true);
        content.put("errorMessage", errorMessage);
    }

    public Map<String, Object> to() {
        return this.content;
    }

    public void setContent(Map<String, Object> content) {
        this.content = content;
    }
}

